import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import test01 from '../components/test1.vue'
import Login from '../components/Login.vue'
import Register from '../components/Register.vue'
Vue.use(VueRouter)
// const test1 = () => import(/* webpackChunkName: "about" */ '../components/test1.vue')

const routes = [
  { path: '/', redirect: '/login' },
  { path: '/login', component: Login },
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path: '/welcome',
    component: test01
  },
  {
    path: '/register',
    component: Register
  },
  {
    path: '/about',
    name: 'About',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  }
]

const router = new VueRouter({
  routes
})

export default router
